<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //1-100平均值
        var sum = 0;
        var average = 0;
        for (var i = 1; i <= 100; i++) {
            sum += i
        }
        average = sum / 100;
        console.log(average);

        //1-100偶数even和奇数odd的和 
        var even = 0;
        var odd = 0;
        for (var i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                even += i
            } else {
                odd += i
            }
        }
        console.log('1-100之间的偶数和是：' + even);
        console.log('1-100之间的奇数和是：' + odd);

        //1-100之间被3整除数字的和
        var num1 = 0
        for (var i = 1; i <= 100; i++) {
            if (i % 3 == 0) {
                num1 += i
            }
        } console.log('1-100之间能被3整除的数的和为：' + num1);
    </script>
</head>

<body>

</body>

</html>